import React, { Component } from 'react'
import { connect } from 'react-redux'
import { QaAction } from '../../actions'

class BigImageMask extends Component {
  clickBigImage = () => {
    const { dispatch } = this.props
    const { toggleBigImage } = QaAction
    dispatch(toggleBigImage(''))
  }
  render() {
    const { big_image_url } = this.props
    return big_image_url ? (
      <div onClick={this.clickBigImage} className="big_image" style={{ backgroundImage: 'url(' + big_image_url + ')' }}></div>
    ) : null
  }
}
const mapStateToProps = (state) => {
  return state.QaState
}
export default connect(mapStateToProps)(BigImageMask)
